﻿using System;
using System.Collections.Generic;
using System.Text;

using CML;

namespace sEmit.Core
{
    class ConfigManager
    {
        Configurator configurator;

        public string ConfigurationFile
        {
            get
            {
                return configurator.ConfigFile;
            }
            set
            {
                configurator.ConfigFile = value;
            }
        }

        public ConfigManager(string ConfigFile)
        {
            configurator.ConfigFile = ConfigFile;
        }

        public void CreateNewConfig()
        {
            CMLWriter writer = new CMLWriter(this.ConfigurationFile);

            CMLElement license = new CMLElement("license");
            CMLElement favouriteslist = new CMLElement("favouriteslist");
            CMLElement favourites = new CMLElement("favourites");
            CMLElement general = new CMLElement("generals");
            CMLElement Security = new CMLElement("Security");

            CMLAttribut agree = new CMLAttribut();
            CMLAttribut change = new CMLAttribut();
            CMLAttribut length = new CMLAttribut();
            CMLAttribut startup = new CMLAttribut();
            CMLAttribut selflogin = new CMLAttribut();
            CMLAttribut remember = new CMLAttribut();
            CMLAttribut loginname = new CMLAttribut();
            CMLAttribut password = new CMLAttribut();
            CMLAttribut provider = new CMLAttribut();

            license.AddAttribut(agree);
            favouriteslist.AddAttribut(change);
            favouriteslist.AddAttribut(length);


            writer.SaveAndClose(false);
        }
    }
}
